﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Database.Models
{
    [Table("PhuongTienCoSo")]
    public class PhuongTienCoSo : BaseModel
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(255)]
        public string Ten { get; set; }

        public int? SoLuong { get; set; }

        public int? TinhTrangHoatDong_Tot { get; set; }

        public int? TinhTrangHoatDong_TrungBinh { get; set; }

        public int? TinhTrangHoatDong_Kem { get; set; }

        public int? TinhTrangHoatDong_HuHong { get; set; }

        public string Vitri { get; set; }

        [NotMapped]
        public string TenPhanLoaiChiTietPhuongTien {
            get
            {
                if (PhanLoaiChiTietPhuongTiens != null)
                {
                    return PhanLoaiChiTietPhuongTiens.Ten;
                }
                return string.Empty;
            }
        }

        public virtual PhanLoaiChiTietPhuongTienPCCCCoSo PhanLoaiChiTietPhuongTiens { get; set; }
        public virtual PhieuDieuTraCoSo PhieuDieuTraCoSoes { get; set; }
        
    }
}
